home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PGEvent.h
-
- Contains: Geometric event structure for the clipper.
-
- Owned by: Jens Alfke (based on algorithm by A. C. Kilgour)
-
- Copyright: © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 3/22/95 jpa Added aet param to MergeWith [1230776]
- <2> 6/30/94 jpa Added dummy destructor for PGEvent to
- appease CodeWarrior compiler.
- <1> 6/15/94 jpa first checked in
- ---------------------------Moved to ODSOM project.
- <1> 5/9/94 jpa first checked in
-
- In Progress:
-
- */
-
- #ifndef _PGEVENT_
- #define _PGEVENT_
-
- #ifndef _ALTPOINT_
- #include "AltPoint.h"
- #endif
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _PRIORTYQ_
- #include "PriortyQ.h"
- #endif
-
- #ifndef _PGCOMMON_
- #include "PGCommon.h"
- #endif
-
- #ifndef _PGEDGE_
- #include "PGEdge.h"
- #endif
-
-
- class PGContour;
- class PGEdge;
- class PGEdgeTable;
- class PGVertex;
- class PGEventQueue;
-
-
- class PGEvent :public Sortable, public ODPoint
- {
- public:
-
- PGEvent( );
- ~PGEvent( ) { } // Keeps CodeWarrior happy
- PGEvent* InitLocalMinEvent( const PGVertex* );
- PGEvent* InitLowEvent( const PGEdge* );
- PGEvent* InitIntersection( const PGEdge*, const PGEdge*,
- const ODPoint § );
-
- virtual ODBoolean ComesBefore( const Sortable* ) const; // From Sortable class
-
- void MergeWith( PGEvent*, PGEdgeTable &aet );
- void Process( PGEdgeTable&, PGEventQueue& );
-
- protected:
- void ConnectEdgePaths( PGEdgeTable &upperEdges );
- void ConnectAdjacentEdgePaths( PGEdgeTable &upperEdges, PGSense firstSense );
-
- PGEdge* fFirstUpperEdge; // 1st edge (in AET) of my upper-edge range
- PGEdge* fLastUpperEdge; // Last edge of upper-edge range
- PGEdgeTable fLowerEdges; // List of lower edges
- };
-
-
- class PGEventQueue :private PriorityQueue
- {
- public:
- PGEventQueue( ODULong suggestedSize )
- :PriorityQueue(suggestedSize)
- { }
-
- PriorityQueue::IsEmpty;
- PriorityQueue::Add;
-
- void AddIntersectionIfBelow( PGEdge*, PGEdge*, const PGEvent *curEv );
-
- PGEvent* First( ) const {return (PGEvent*)PriorityQueue::GetFirst();}
- PGEvent* RmvFirst( ) {return (PGEvent*)PriorityQueue::RemoveFirst();}
- };
-
- #endif /*_PGEVENT_*/
-